package com.p2p.controller.contentManagement;

import com.p2p.common.R;
import com.p2p.common.view.AdviceVo;
import com.p2p.entity.Advice;
import io.swagger.annotations.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping(value = "/advice")
@Api(value = "意见反馈",tags = "意见反馈接口API")
public class AdviceController {

    @RequestMapping(value = "/findAllAdvice",method = RequestMethod.GET)
    @ApiOperation(value = "显示所有的意见反馈",notes = "显示所有的意见反馈",httpMethod = "GET", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数默认第一页",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示记录数",paramType = "query",dataType = "String",required = true)
    })
    @ResponseBody
    public R findAllAdvice(Integer currentPage,Integer pageSize){
        return null;
    }


    @RequestMapping(value = "/findAdviceById",method = RequestMethod.POST)
    @ApiOperation(value = "返回该意见反馈",notes = "返回该意见反馈",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "反馈id",paramType = "query",dataType = "String",required = true)
    })
    @ResponseBody
    public R findAdviceById(Integer id){
        return null;
    }

    @GetMapping (value = "/findAdviceByCondition")
    @ApiOperation(value = "符合条件的建议",notes = "符合条件的建议",httpMethod = "GET", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ResponseBody
    public R findAdviceByCondition(@RequestBody @ApiParam(name = "adviceVo",value = "条件",required = true) AdviceVo adviceVo){
        return null;
    }

    @RequestMapping(value = "/addAdvice",method = RequestMethod.POST)
    @ApiOperation(value = "添加意见反馈",notes = "添加意见反馈",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ResponseBody
    public R addAdvice(@RequestBody @ApiParam(name = "advice",value = "反馈实体",required = true)Advice advice){
        return null;
    }

    @RequestMapping(value = "/deleteAdviceById",method = RequestMethod.POST)
    @ApiOperation(value = "删除一条意见反馈",notes = "删除一条意见反馈",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "反馈id",paramType = "query",dataType = "String",required = true)
    })
    @ResponseBody
    public R deleteAdviceById(Integer id){
        return null;
    }

    @RequestMapping(value = "/updateAdvice",method = RequestMethod.POST)
    @ApiOperation(value = "修改意见反馈",notes = "修改意见反馈",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ResponseBody
    public R updateAdvice(@RequestBody @ApiParam(name = "advice",value = "反馈实体",required = true)Advice advice){
        return null;
    }
}
